import Vue from 'vue'
import App from '@/App'
import router from '@/router'                 // api: https://github.com/vuejs/vue-router
import store from '@/store'                   // api: https://github.com/vuejs/vuex
import VueCookie from 'vue-cookie'            // api: https://github.com/alfhen/vue-cookie
import '@/element-ui'                         // api: https://github.com/ElemeFE/element
import '@/icons'                              // api: http://www.iconfont.cn/
import '@/element-ui-theme'
import '@/assets/scss/index.scss'
import echarts from 'echarts' // 引入echarts
import {treeDataTranslate, transOrg, transUser, transDict} from '@/utils'
import cloneDeep from 'lodash/cloneDeep'
import ElDict from './components/el-dict'
import Ueditor from './components/ueditor'
import '@/utils/filter'
import yhRules from '@/utils/rules'
import delConfirm from '@/utils/confirm'
import validateSubmit from '@/utils/validateSubmit'
import message from '@/utils/message'
import util from '@/utils/util'
import './components/yh-searchBox/index.js'
import '@/router/permission'

// import cnLang from 'element-ui/lib/locale/lang/zh-CN'
// import enLang from 'element-ui/lib/locale/lang/en'
// import locale from 'element-ui/lib/locale'
// locale.use(cnLang)

/*document.cookie = "JSESSIONID=9F36C52CAE97E967246210E331D87D17; path=/";
document.cookie = "wx-remember=QkczUXowTXRFTk1raERlZVBFaHo1dyUzRCUzRDpEOFgwa3JLS1NKblliS2RWaDBNVU5BJTNEJTNE; path=/";*/
import VueQriously from 'vue-qriously'

// 易惠拓展组件
import YhPlugComponents from '@/components/yh-plug-components'
import Direvtive from '@/directive'

Vue.use(YhPlugComponents)
Vue.use(VueCookie)
Vue.use(ElDict)
Vue.use(Ueditor)
Vue.use(yhRules)
Vue.use(Direvtive)
Vue.use(VueQriously)

Vue.component('el-dict', ElDict)
Vue.component('ueditor', Ueditor)

Vue.config.productionTip = false

// 挂载全局
Vue.prototype.$echarts = echarts
Vue.prototype.treeDataTranslate = treeDataTranslate     // 树形数据转换
Vue.prototype.transOrg = transOrg     // 机构翻译
Vue.prototype.transUser = transUser     // 用户翻译
Vue.prototype.transDict = transDict     // 数据字典翻译
Vue.prototype.delConfirm = delConfirm   // 删除确认
Vue.prototype.$validateSubmit = validateSubmit   // submit提交前验证
Vue.prototype.$messageTip = message   // 操作成功提示
Vue.prototype.$util = util   // 公用方法

// 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)
Vue.filter('moneyInt', util.formatMoneyInt)
Vue.filter('money', util.formatMoney)
/* eslint-disable no-new */

let vm = new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
window.vue = vm
